<template>
  <div class="loginMin">
    <div class="login-html">
      <input id="tab-1" type="radio" name="tab" class="sign-in" checked /><label
        for="tab-1"
        class="tab"
        >登录</label
      >
      <input id="tab-2" type="radio" name="tab" class="sign-up" /><label
        for="tab-2"
        class="tab"
        >注册</label
      >

      <div class="login-form">
        <div class="sign-in-htm">
          <slot name="login"></slot>
        </div>

        <div class="sign-up-htm">
          <slot name="register"></slot>
          <div class="hr"></div>
          <div class="foot-lnk">
            <label for="tab-1">已注册登录? </label>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts"></script>

<style lang="scss" scoped>
input,
button {
  outline: none;
  border: none;
}
.loginMin {
  width: 100%;
  height: 100%;
  min-width: 360px;
  position: relative;
  display: none;
  box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24),
    0 17px 50px 0 rgba(0, 0, 0, 0.19);
  .login-html {
    width: 100%;
    height: 100%;
    position: absolute;
    padding: 90px 30px 50px 30px;
  }

  .login-html .sign-in-htm,
  .login-html .sign-up-htm {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    position: absolute;
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transition: all 0.4s linear;
    transition: all 0.4s linear;
    color: #fff;
    padding-top: 20px;
  }

  .login-html .sign-in,
  .login-html .sign-up {
    display: none;
  }
  .login-html .tab {
    font-size: 22px;
    margin-right: 15px;
    padding-bottom: 5px;
    margin: 0 15px 10px 0;
    display: inline-block;
    border-bottom: 2px solid transparent;
    text-transform: uppercase;
    color: #ddd;
  }
  .login-html .sign-in:checked + .tab,
  .login-html .sign-up:checked + .tab {
    color: #fff;
    border-color: #1161ee;
  }
  .login-form {
    min-height: 345px;
    position: relative;
    -webkit-perspective: 1000px;
    perspective: 1000px;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
  }
  .login-html
    .sign-in:checked
    + .tab
    + .sign-up
    + .tab
    + .login-form
    .sign-in-htm {
    -webkit-transform: rotate(0);
    -ms-transform: rotate(0);
    transform: rotate(0);
  }
  .login-html .sign-up:checked + .tab + .login-form .sign-up-htm {
    -webkit-transform: rotate(0);
    -ms-transform: rotate(0);
    transform: rotate(0);
  }

  .hr {
    height: 2px;
    margin: 60px 0 50px 0;
    background: rgba(255, 255, 255, 0.9);
  }
  .foot-lnk {
    text-align: center;
  }
}

@media (max-width: 760px) {
  .loginMin {
    display: block;
  }
}
</style>
